Computing in School: ML for Kids

The term "machine learning" gets bandied around in the press all the time these days. How many pupils when they come across this term understand what it means? How is it exactly that a machine "learns"? The website machine learning for kids MLFK goes some way to helping with the problem of educating pupils on the process of machine learning. What it doesn't do is look into the black box of the machine learning algorithm. For this you'd need a lot more maths. I've currently used this website with A-level pupils (aged 16-18) and GCSE pupils (aged 14-16). I'm going to describe my experience here to give you an idea about whether or not you want to give it a go.

The first thing to do is set up a teacher account. This involves setting up a free account on IBM's Watson Cloud Compute service and connecting it to the MLFK website. With the excellent step by step instructions provided I found this pretty straight forward. Then you set up some accounts for the pupils to use. Now the free account on IMB Watson only allows you so many accounts to train models simultaneously. For example, for simple text based models you get 5 simultaneous accounts. However, what the website does allow you to do is set up group collaborative projects. So a few pupils or indeed a whole class can contribute to the same project. Whole class projects were the way I used the website.

The first project I tried was a text based model. I set up two categories labeled "nice comments" and "nasty comments" and I encouraged the pupils to submit comments to each category. They were informed that comments were not allowed to be personal and they should be school appropriate. I monitored the submitted comments and deleted anything that didn't meet these expectations. They were pretty sensible, but quite creative in making comments with words I had never heard before! A bit of Googling followed to make sure they were appropriate! After we had a around 50 or so comments in each category we sent the model off to be "trained" by IBM Watson. And this is where it feels a little bit of a black box. There is no indication given about how the model is trained. That aside for the moment, it generally doesn't take very long to train a text based model. When finished a text box appears where pupils can enter different nice and nasty comments and the model will return which category it fits into and what it's percentage confidence is. My challenge to the pupils was to fool the model. Could they make it categorise a nice comment as a nasty one. Once they'd achieved this we talked about what examples fooled the model and how that might have happened. We then went back to the training examples and added more in that would attempt to fix the incorrect classifications. This gave pupils a good overview of the process involved in training a model. What it didn't do was give any insight into the black box. The website does acknowledge this and provides a section dedicated to resources for teaching the internals of the models.

The second project we tackled was an image classifier. I gave the pupils the categories "cat" and "dog". They went away and found images online for as many different cats and dogs as they could find. Then we repeated the same process as above, uploading the photos to the website. This took a bit longer to train so it's worth having something else to do whilst it completes. There are some interesting experiments to try with this project. For example if you fill the dog category with pictures that have sky in them and the cat category with pictures that are taken at night will the model focus on the content of the image or will the background dominate? I also tried getting the pupils to sketch pictures of dogs and cats. The website includes a function for this. It worked surprisingly well.

The third project I tried was using a webcam to take pictures of the pupils faces and train a model to recognise them. This was a bit more limited in how accurate it was, but it started a discussion about the size and variation of the data set. We probably needed to upload a lot more photos of the pupils.

I had a discussion recently with a computer scientist friend of mine about the pedagogical nature of how computer science should be taught. He was of the opinion that things should be taught from the bottom up. For example, starting with the basic algorithms and building on them gradually. However, I feel that pupils often lack motivation if they cannot see an application to what they are learning and I postulated that a top down approach was an alternative. Starting with the MLFK website pupils can get a feel for how ML works. The next step down could be a description of how a some aspects of text classifier work. I think pupils could get there heads around the concepts of stemming and n-grams. One further level down would be studying a particular algorithm in detail and coding it up. I haven't tried this yet with pupils but I will let you know when I do.

In conclusion I would thoroughly recommend giving MLFK a go. It's great fun and gives pupils a fantastic insight into real world applications of computer science.

Comments